// showpt.cpp -- setting the precision, showing trailing point
#include <iostream>

int main() {
    using std::cout;
    using std::ios_base;

    constexpr float price1 = 20.40;
    constexpr float price2 = 1.9 + 8.0 / 9.0;

    // 显示末尾小数点
    cout.setf(ios_base::showpoint);
    cout << "\"Furry Friends\" is $" << price1 << "!\n";
    cout << "\"Fiery Friends\" is $" << price2 << "!\n";

    // 设置浮点数显示精度
    cout.precision(2);
    cout << "\"Furry Friends\" is $" << price1 << "!\n";
    cout << "\"Fiery Friends\" is $" << price2 << "!\n";

    // 定点计数法
    cout.setf(ios_base::fixed);
    cout << "\"Furry Friends\" is $" << price1 << "!\n";
    cout << "\"Fiery Friends\" is $" << price2 << "!\n";
    return 0;
}